import Cookies from 'js-cookie'

const TokenKey = 'bawf_token'
const refreshToken = 'bawf_refreshToken'
export function getToken() {
  return JSON.parse(localStorage.getItem(TokenKey))
}

export function setToken(token) {
  return localStorage.setItem(TokenKey, JSON.stringify(token))
}

export function removeToken() {
  return localStorage.clear()
}

export function getRefreshToken() {
  return JSON.parse(localStorage.getItem(refreshToken))
}

export function setRefreshToken(refresh) {
  return localStorage.setItem(refreshToken, JSON.stringify(refresh))
}

export function removeRefreshToken() {
  return localStorage.clear()
}